package com.huitu.whht.base.core.api.gb.task;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;

import com.huitu.whht.base.core.api.gb.task.entities.GbTask;

import com.huitu.whht.base.core.api.gb.task.entities.GbTaskQo;
import com.huitu.whht.base.core.api.gb.task.service.IGbTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 填报水资源公报任务表API,表名称: T_WHHT_GB_TASK <br/>
 * 日期: 2019-04-11
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("gb/task")
public class GbTaskResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(GbTaskResource.class);

    private static final String UUID = "db954a1b-6a43-426d-8af4-2304b2599e0b";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IGbTaskService gbTaskService;

    /**
     * @api {get} gb/task/{taskId:\\w{32}} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)select by primary key
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiSampleRequest gb/task/b516942af6714c059652e816a9ce42ec
     * @apiParam   {String}         taskId             【必须】任务ID
     * @apiSuccess {String}         taskId             任务ID
     * @apiSuccess {String}         taskNm             任务名称
     * @apiSuccess {String}         gbTable            水资源公报表名
     * @apiSuccess {Integer}        gbYear             水资源公报年份
     * @apiSuccess {String}         cUserId            创建人ID
     * @apiSuccess {String}         aUserId            填报人ID
     * @apiSuccess {Date}           cTaskTm            创建任务日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           bgTm               预计开始填报日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           edTm               预计终止日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiSuccess {Double}         jdt                进度
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         auditorId          审核人ID
     * @apiSuccess {String}         cTel               创建人联系方式
     * @apiSuccess {String}         aTel               填报人联系方式
     * @apiSuccess {String}         orgCd              填报单位ID
     * @apiSuccess {Double}         gbNum              公报表序号
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{taskId:\\w{32}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("taskId") String taskId) {
        LOGGER.info("根据主键查询 填报水资源公报任务表,参数 taskId:{}", taskId);
        return Response.ok(ApiResultBuilder.create(this, gbTaskService.selectByPrimaryKey(taskId))).build();
    }

    /**
     * @api {post} gb/task/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)select by filter
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiSampleRequest gb/task/list
     * @apiParam   {List(String)}   taskIdList         (数组)任务ID
     * @apiParam   {String}         taskId             任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {List(Integer)}  gbYearList         (数组)水资源公报年份
     * @apiParam   {List(String)}   cUserIdList        (数组)创建人ID
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {List(String)}   aUserIdList        (数组)填报人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTmBgTm        (开始时间)创建任务日期
     * @apiParam   {Date}           cTaskTmEdTm        (结束时间)创建任务日期
     * @apiParam   {Date}           bgTmBgTm           (开始时间)预计开始填报日期
     * @apiParam   {Date}           bgTmEdTm           (结束时间)预计开始填报日期
     * @apiParam   {Date}           edTmBgTm           (开始时间)预计终止日期
     * @apiParam   {Date}           edTmEdTm           (结束时间)预计终止日期
     * @apiParam   {List(String)}   taskStutasList     (数组)任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {List(Double)}   jdtList            (数组)进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   auditorIdList      (数组)审核人ID
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {List(String)}   orgCdList          (数组)填报单位ID
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNumMin           (最小)公报表序号
     * @apiParam   {Double}         gbNumMax           (最大)公报表序号
     * @apiSuccess {String}         taskId             任务ID
     * @apiSuccess {String}         taskNm             任务名称
     * @apiSuccess {String}         gbTable            水资源公报表名
     * @apiSuccess {Integer}        gbYear             水资源公报年份
     * @apiSuccess {String}         cUserId            创建人ID
     * @apiSuccess {String}         aUserId            填报人ID
     * @apiSuccess {Date}           cTaskTm            创建任务日期
     * @apiSuccess {Date}           bgTm               预计开始填报日期
     * @apiSuccess {Date}           edTm               预计终止日期
     * @apiSuccess {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiSuccess {Double}         jdt                进度
     * @apiSuccess {String}         nt                 备注
     * @apiSuccess {String}         auditorId          审核人ID
     * @apiSuccess {String}         cTel               创建人联系方式
     * @apiSuccess {String}         aTel               填报人联系方式
     * @apiSuccess {String}         orgCd              填报单位ID
     * @apiSuccess {Double}         gbNum              公报表序号
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(GbTaskQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 填报水资源公报任务表,参数 GbTaskQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, gbTaskService.selectList(filter))).build();
    }

    /**
     * @api {put} gb/task [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)add data
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiParam   {String}         taskId             【必须】任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {Integer}        gbYear             水资源公报年份
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTm            创建任务日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           bgTm               预计开始填报日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           edTm               预计终止日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {Double}         jdt                进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNum              公报表序号
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest gb/task
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "taskId": "b516942af6714c059652e816a9ce42ec"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "taskId": "b516942af6714c059652e816a9ce42ec"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(GbTask record) {
        LOGGER.info("新增 填报水资源公报任务表,参数 GbTask:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(gbTaskService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} gb/task/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)addBatch data
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiParam   {String}         taskId             【必须】任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {Integer}        gbYear             水资源公报年份
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTm            创建任务日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           bgTm               预计开始填报日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           edTm               预计终止日期(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {Double}         jdt                进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNum              公报表序号
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest gb/task/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "taskId": "b516942af6714c059652e816a9ce42ec"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "taskId": "b516942af6714c059652e816a9ce42ec"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<GbTask> recordList) {
        LOGGER.info("批量新增 填报水资源公报任务表,参数 GbTask:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(gbTaskService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} gb/task/{taskId:\\w{32}}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)update data
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiParam   {String}         taskId             【必须】任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {Integer}        gbYear             水资源公报年份
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTm            创建任务日期
     * @apiParam   {Date}           bgTm               预计开始填报日期
     * @apiParam   {Date}           edTm               预计终止日期
     * @apiParam   {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {Double}         jdt                进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNum              公报表序号
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest gb/task/b516942af6714c059652e816a9ce42ec/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{taskId:\\w{32}}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("taskId") String taskId, GbTask record) {
        record.setTaskId(taskId);
        LOGGER.info("根据主键修改 填报水资源公报任务表,参数 GbTask:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(gbTaskService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} gb/task/{taskId:\\w{32}}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改T_WHHT_GB_TASK(填报水资源公报任务表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiParam   {String}         taskId             任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {Integer}        gbYear             水资源公报年份
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTm            创建任务日期
     * @apiParam   {Date}           bgTm               预计开始填报日期
     * @apiParam   {Date}           edTm               预计终止日期
     * @apiParam   {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {Double}         jdt                进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNum              公报表序号
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest gb/task/b516942af6714c059652e816a9ce42ec/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{taskId:\\w{32}}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("taskId") String taskId, GbTask record) {
        record.setTaskId(taskId);
        LOGGER.info("根据主键修改(只修改非null字段) 填报水资源公报任务表,参数 GbTask:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(gbTaskService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} gb/task/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改T_WHHT_GB_TASK(填报水资源公报任务表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiParam   {String}         taskId             任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {Integer}        gbYear             水资源公报年份
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTm            创建任务日期
     * @apiParam   {Date}           bgTm               预计开始填报日期
     * @apiParam   {Date}           edTm               预计终止日期
     * @apiParam   {String}         taskStutas         任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {Double}         jdt                进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNum              公报表序号
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  gb/task/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "taskId": "b516942af6714c059652e816a9ce42ec",
     * "taskNm": "附表22 2018年水利工程原水水价信息表",
     * "gbTable": "T_WHHT_GB_SLGCYSSJ",
     * "gbYear": 2,018,
     * "cUserId": "a76aa852-2c90-49e1-9b9d-c1a097c05c31",
     * "aUserId": "8b848267-9f46-44f3-bdb5-de3c4b5d07d3",
     * "cTaskTm": "2019-03-14 17:43:08.0",
     * "bgTm": null,
     * "edTm": null,
     * "taskStutas": "0",
     * "jdt": 0,
     * "nt": null,
     * "auditorId": null,
     * "cTel": "17612735616",
     * "aTel": "17612735616",
     * "orgCd": "011043321",
     * "gbNum": 22
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<GbTask> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 填报水资源公报任务表,参数 GbTask:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(gbTaskService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} gb/task/{taskId:\\w{32}} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiSampleRequest gb/task/b516942af6714c059652e816a9ce42ec
     * @apiParam   {String}         taskId             【必须】任务ID
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{taskId:\\w{32}}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("taskId") String taskId) {
        LOGGER.info("根据主键删除 填报水资源公报任务表,参数 taskId:{}", taskId);
        Integer rows = gbTaskService.deleteByPrimaryKey(taskId);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} gb/task/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除T_WHHT_GB_TASK(填报水资源公报任务表)数据
     * @apiName (generate)delete by filter
     * @apiGroup GB_TASK-填报水资源公报任务表
     * @apiVersion 1.0.0
     * @apiSampleRequest gb/task/by-filter
     * @apiParam   {List(String)}   taskIdList         (数组)任务ID
     * @apiParam   {String}         taskId             任务ID
     * @apiParam   {String}         taskNm             任务名称
     * @apiParam   {String}         gbTable            水资源公报表名
     * @apiParam   {List(Integer)}  gbYearList         (数组)水资源公报年份
     * @apiParam   {List(String)}   cUserIdList        (数组)创建人ID
     * @apiParam   {String}         cUserId            创建人ID
     * @apiParam   {List(String)}   aUserIdList        (数组)填报人ID
     * @apiParam   {String}         aUserId            填报人ID
     * @apiParam   {Date}           cTaskTmBgTm        (开始时间)创建任务日期
     * @apiParam   {Date}           cTaskTmEdTm        (结束时间)创建任务日期
     * @apiParam   {Date}           bgTmBgTm           (开始时间)预计开始填报日期
     * @apiParam   {Date}           bgTmEdTm           (结束时间)预计开始填报日期
     * @apiParam   {Date}           edTmBgTm           (开始时间)预计终止日期
     * @apiParam   {Date}           edTmEdTm           (结束时间)预计终止日期
     * @apiParam   {List(String)}   taskStutasList     (数组)任务状态（0：创建任务了，但未下发；1：下发任务，等待填报；2：填报完成，未审核；3：已审核）
     * @apiParam   {List(Double)}   jdtList            (数组)进度
     * @apiParam   {String}         nt                 备注
     * @apiParam   {List(String)}   auditorIdList      (数组)审核人ID
     * @apiParam   {String}         auditorId          审核人ID
     * @apiParam   {String}         cTel               创建人联系方式
     * @apiParam   {String}         aTel               填报人联系方式
     * @apiParam   {List(String)}   orgCdList          (数组)填报单位ID
     * @apiParam   {String}         orgCd              填报单位ID
     * @apiParam   {Double}         gbNumMin           (最小)公报表序号
     * @apiParam   {Double}         gbNumMax           (最大)公报表序号
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(GbTaskQo filter) {
        LOGGER.info("根据条件删除 填报水资源公报任务表,参数 GbTaskQo:{}", filter);
        Integer rows = gbTaskService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
